package com.ssk.service;

import com.ssk.dao.OrderDao;
import com.ssk.model.Order;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderService {

    @Autowired
    private OrderDao orderDao;

    public List<Order> findAll() {
        return orderDao.findAll();
    }

    public Order findById(int id) {
        return orderDao.findById(id);
    }

    public List<Order> findByItemId(String itemId) {
        return orderDao.findByItemId(itemId);
    }

    public boolean save(Order order){
        return orderDao.save(order) > 0;
    }

}
